<?php

namespace crmeb\listens;

use app\common\repositories\activity\NewActivityRepository;
use crmeb\services\TimerService;
use Swoole\Timer;
use think\facade\Log;
use crmeb\interfaces\ListenerInterface;


class NewActivityTimeCheckListen extends TimerService implements ListenerInterface
{
    public function handle($event): void
    {
        $this->tick(1000 * 60, function () {
            $make = app()->make(NewActivityRepository::class);
            try {
                $make->valActiveStatus();
            } catch (\Exception $e) {
                Log::info('自动更新新人活动状态失败' . date('Y-m-d H:i:s', time()));
            }
        });
    }
}
